package com.chance.cc.crawler.prod.command.trigger.domain.news.ifeng;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.ifeng.realtime.IFengRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.ifeng.trace.IFengCommentTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.ifeng.trace.IFengTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2021-04-11 17:54:34
 * @email okprog@sina.com
 */
public class IfengCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {
        publishIFengRealtimeScheduleTriggerInfo();

        publishIFengTraceScheduleTriggerInfo();

        publishIFengCommentTraceScheduleTriggerInfo();
    }

    public static void publishIFengRealtimeScheduleTriggerInfo(){
        CrawlerJob crawlerJob = IFengRealtimeCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                IFengRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "凤凰新闻实时采集任务，每十分钟采集一次");
    }

    public static void publishIFengTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = IFengTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                IFengTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 30 0 * * ?",
                "凤凰新闻追溯7日评论采集任务，每天采集一次");
    }

    public static void publishIFengCommentTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = IFengCommentTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                IFengCommentTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 * * * ?",
                "凤凰新闻追溯当日评论采集任务，每小时采集一次");
    }
}
